<?php

function POST($url, $data) {
	$ch = curl_init();

	//set the url, number of POST vars, POST data
	curl_setopt($ch,CURLOPT_URL, $url);
	curl_setopt($ch,CURLOPT_POST, 1);
	curl_setopt($ch,CURLOPT_POSTFIELDS, $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	
	//execute post
	$result = curl_exec($ch);

	//close connection
	curl_close($ch);
	//var_dump($result);
    return $result;
}

function GET($URI)
{
	$contextData = array ( 
					'method' => 'GET',
					'header' => "Connection: close\r\n" );
	 
	// Create context resource for our request
	$context = stream_context_create (array ( 'http' => $contextData ));
	 
	// Read page rendered as result of your POST request
	$result =  file_get_contents (
					  $URI);
					  
	return $result;
}

?>